﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Linq.Expressions;

namespace JXT.PrimaryKey.Batman.Domain.Repositories.SqlServer.Expressions {
    public class OrderQuery : ISqlQuery {
        protected StringBuilder sb = new StringBuilder();

        #region ISqlQuery Members

        public string QueryText {
            get { return sb.ToString(); }
        }

        public System.Data.IDataParameter[] Parameters {
            get { return null; }
        }

        #endregion

        internal OrderQuery() {
        }

        internal void Descending(string text) {
            if (sb.Length > 0)
                sb.Append(", ");
            sb.AppendFormat("order by {0} desc", text);
        }

        internal void Ascending(string text) {
            if (sb.Length > 0)
                sb.Append(", ");
            sb.AppendFormat("order by {0} asc", text);
        }
    }
}
